<template>
  <div id="qianqichjgcs" class="app-container" v-loading="loading">
    <div class="tabs dachuShenChaBox">
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="图件审查" name="1"></el-tab-pane>
        <el-tab-pane label="附件审查" name="2"></el-tab-pane>
      </el-tabs>
      <div class="dachuShenCha">
        <div class="dachuShenCha_item" @click="exportOpinion">
          <i class="el-icon-upload2"></i> 导出审查意见
        </div>
        <div class="dachuShenCha_item" v-if="!isLook" @click="checkTijiao">
          <i class="el-icon-document-checked"></i> 校验审查意见
        </div>
      </div>
    </div>
    <div class="tdMap-box" v-show="activeName=='1'">
      <tdMap
        ref="tdMap"
        :pkList="list"
        :isShowXztBtn="false"
        :xianZhuangPath="xianZhuangFliePath"
        :cuowuList="cuowuListData"
        :yijianInfo="yijianInfoData"
        :isLook="isLook"
      >
        <template slot="buttonGroup">
          <!-- <el-button @click="handleXzViewInto" size="medium">现状图</el-button> -->
          <el-dropdown class="CAD" @command="handleXzViewInto">
            <el-button class="line" size="medium">
              CAD查看
              <i class="el-icon-arrow-down el-icon--right"></i>
            </el-button>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item command="66">复垦前远近图查看</el-dropdown-item>
              <el-dropdown-item command="67">复垦后远近图查看</el-dropdown-item>
              <el-dropdown-item command="1">工程布局图</el-dropdown-item>
              <el-dropdown-item command="2">规划图</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
          <!-- <el-button @click="handleXzViewInto(1)" size="medium">工程布局图</el-button> -->
          <!-- <el-button @click="handleXzViewInto(2)" size="medium">规划图</el-button> -->
        </template>
        <div v-if="curIndex != null" slot="popupBaseInfo" >
         
          <table cellspacing="0" class="tableBasicInfo">
            <tr>
              <th>权利人</th>
              <td>{{list[curIndex].qlr}}</td>
            </tr>
            <tr>
              <th>身份证号</th>
              <td>{{list[curIndex].idCard}}</td>
            </tr>
            <tr>
              <th>所在乡镇</th>
              <td>{{list[curIndex].townName}}</td>
            </tr>
            <tr>
              <th>建设用地复垦面积</th>
              <td>{{list[curIndex].nczjd}}</td>
            </tr>
            <tr>
              <th>农村宅基地面积(㎡)</th>
              <td>{{list[curIndex].zjdfs}}</td>
            </tr>
            <tr>
              <th>预计减少建设用地面积</th>
              <td>{{list[curIndex].jsjsydmj}}</td>
            </tr>
            <tr>
              <th>预计增加农用地面积</th>
              <td>{{list[curIndex].yjxznydmj}}</td>
            </tr>
            <tr>
              <th>预计增加耕地面积</th>
              <td>{{list[curIndex].xzgdmj}}</td>
            </tr>
            <tr>
              <th>预计增加林地面积</th>
              <td>{{list[curIndex].xzldmj}}</td>
            </tr>
            <tr>
              <th>预计增加园地面积</th>
              <td>{{list[curIndex].zjydmj}}</td>
            </tr>
            <tr>
              <th>预计增加其他农用地面积</th>
              <td>{{list[curIndex].xzqtnydmj}}</td>
            </tr>
            <tr>
              <th>拟复垦宅基地产权证号</th>
              <td>{{list[curIndex].nfkzjdcq}}</td>
            </tr>
            <tr>
              <th>采用用地附属</th>
              <td>{{list[curIndex].cyydfs}}</td>
            </tr>
          </table>
          
          
        </div>
        <div slot="popupJgInfo">监管信息</div>
      </tdMap>
      
    </div>

    <div class="fujianShenCha" v-show="activeName=='2'">
      <div class="fujianList">
        <div class="fujianList_item" v-for="(item,index) in attachmentInfo" :key="index">
          <p>{{item.fileName}}</p>
          <el-button @click="checkAttachment(item)">
            <!-- {{item.opinionStatus=='AUDIT'?'审查':item.opinionStatus=='VIEW'?'已审查':'审查'}} -->
            {{item.opinionStatus=='AUDIT'?'审查':((item.opinionStatus=='AUDIT' && item.code=='view')?'查看':item.opinionStatus=='VIEW'?'查看':(item.opinionStatus=='VIEW' && item.code=='view')?'查看':'审查')}}
          </el-button>
        </div>
      </div>

      <div class="chaKanBox" v-if="showChaKan">
        <div class="showDetail">
          <div class="chaKanBox_left">
            <div style="width:600px;height:500px;">
              <iframe
                :src="$https+attachment.filePath"
                frameborder="0"
                style="width:100%;height:100%;"
              ></iframe>
            </div>
          </div>
          <!-- attachment.opinionStatus=='VIEW' && attachment.code=='VIEW' -->
          <div class="chaKanBox_right" v-show="isShowCheck">
            <div class="chaKanBox_right_item chaKanBox_right_select">
              <p>意见类型：</p>
              <el-select v-model="opinionValue" @change="changeText" placeholder="--请选择--">
                <el-option
                  v-for="item in opionionList"
                  :key="item.code"
                  :label="item.name"
                  :value="item.code"
                ></el-option>
              </el-select>
            </div>
            <div class="chaKanBox_right_item textarea" v-if="isText">
              <el-input
                class="chaKanBox_right_item_textarea"
                type="textarea"
                :rows="10"
                :readonly="isReadOnly"
                placeholder="请输入内容"
                v-model="opinionContent"
              ></el-input>
            </div>
            <div class="chaKanBox_right_item button" v-if="!isLook">
              <el-button
                type="primary"
                v-loading.fullscreen.lock="fullscreenLoading"
                @click="btnOpinion"
                element-loading-text="拼命加载中"
                element-loading-spinner="el-icon-loading"
                element-loading-background="rgba(0, 0, 0, 0.8)"
              >提交</el-button>
            </div>
          </div>
        </div>
      </div>
    </div>
    <el-dialog
      title="审查意见"
      :visible.sync="shenchaFlag1"
      :before-close="handleClose1"
      class="shenChaTanKuang"
    >
      <div class="shenChaContent">
        <div class="shenchaItem">
          <p>该片块图件是否存在问题：</p>
          <div class="shenchaItem_item">
            <el-radio-group v-model="itemDataForTable.isExistQuestions" @change="isChangeSelect">
              <el-radio label="YES">是</el-radio>
              <el-radio label="NO">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="shenchaItem">
          <p>是否设定为疑问复垦点：</p>
          <div class="shenchaItem_item">
            <el-radio-group v-model="itemDataForTable.isSetFukend">
              <el-radio label="YES">是</el-radio>
              <el-radio label="NO">否</el-radio>
            </el-radio-group>
          </div>
        </div>
        <div class="shenchaItem_item" v-if="noWenti">
          <p>问题类型：</p>
          <div class="shenchaItem_item">
            <el-select
              class="shenchaBox_item_input"
              v-model="itemDataForTable.problemReclaimPointOpinionType"
              placeholder="--请选择--"
            >
              <el-option
                v-for="item in qswuowuList"
                :key="item.code"
                :label="item.name"
                :value="item.code"
              ></el-option>
            </el-select>
          </div>
        </div>
        <div class="shenchaItem_item_noFlex">
          <p>问题记录：</p>
          <div class="shenchaItem_item">
            <el-input
              class="shenchaItem_item_textarea"
              type="textarea"
              :rows="5"
              :readonly="isReadOnly"
              placeholder="请输入内容"
              v-model="itemDataForTable.problemReclaimProblemRecord"
            ></el-input>
          </div>
        </div>
      </div>
      <span slot="footer" class="dialog-footer" v-if="!isLook">
        <el-button @click="shenchaFlag1 = false">取 消</el-button>
        <el-button
          v-loading.fullscreen.lock="fullscreenLoading"
          element-loading-text="拼命加载中"
          element-loading-spinner="el-icon-loading"
          element-loading-background="rgba(0, 0, 0, 0.8)"
          type="primary"
          @click="submitYj1"
        >确 定</el-button>
      </span>
    </el-dialog>

    <!-- 查看复垦前后图片 -->
    <el-dialog :title="seeImgTitle" :visible.sync="seeImgDialog" width="50%">
      <div class="seeImg">
        <ul>
          <li v-for="(item,index) in imgArr" :key="index">
            <p>{{item.fileName}}</p>
            <img :src="$https+item.filePath" />
          </li>
          <li style="width:100%">
            <p>{{quanImg.fileName}}</p>
            <div ref="panorama" class="imgBox" style="text-align:center;width:100%;height:500px"></div>
          </li>
        </ul>
      </div>
    </el-dialog>
    <el-dialog
      title="外业审查意见"
      :visible.sync="shenchaFlag2"
      :before-close="handleClose2"
      class="shenChaTanKuang"
    >
      <div class="shenChaContent">
        <div class="shenchaItem">
          <p>是否通过：</p>
          <div class="shenchaItem_item">
            <el-radio-group v-model="waiyeObj.waiyeRadio">
              <el-radio label="YES">是</el-radio>
              <el-radio label="NO">否</el-radio>
            </el-radio-group>
          </div>
        </div>
      </div>
      <span slot="footer" class="dialog-footer"  v-if="!isLook">
        <el-button @click="shenchaFlag2 = false">取 消</el-button>
        <el-button
          v-loading.fullscreen.lock="fullscreenLoading"
          element-loading-text="拼命加载中"
          element-loading-spinner="el-icon-loading"
          element-loading-background="rgba(0, 0, 0, 0.8)"
          type="primary"
          @click="submitWy"
        >确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import {
  queryOpinionType,
  exportOpinion,
  queryLandCertificateSectiondAuditInfo,
  queryCheckEnclosure,
  checkEnclosureOpinion,
  auditSecondAuditInfo,
  saveCheckEnclosureOpinion,
  verifyAttachmentOpinion,
  queryEarlyXzt,
  queryJungongXzt,
  auditEarlyStatusMapInfo,
  auditLandStatusMapInfo,
  hgzAuditLandOuterInfo
} from "@/api/shijiChouchaFuhe";

import {
  getNormalOpinionType,
  getQuestionsOpinionType
} from "@/api/getOpinion";
import tdMap from "@/components/tdMap";

import { exportReviewOpinions } from "@/api/storeForRecordSee";
import { truncate } from "fs";
import PhotoSphereViewer from "photo-sphere-viewer";
import "photo-sphere-viewer/dist/photo-sphere-viewer.css";
export default {
  filters: {},
  components: {
    tdMap
  },
  data() {
    return {
      xianZhuangFliePath: "",
      cuowuListData: [],
      qswuowuList: [],
      noWenti: false,
      shenchaFlag1: false,
      xianzhuangtuSrc: "",
      dialogTitle1: "前期测绘现状图",
      //外业单选
      waiyeObj: {
        waiyeRadio: "",
        landId: ""
      },
      shenchaFlag2: false,
      qswuowuList: [],
      noWenti: true,
      shenchaFlag1: false,
      xianzhuangtuSrc: "",
      dialogTitle1: "前期测绘现状图",
      fullscreenLoading: false, //全屏加载
      cuowuList: [], //错误类型数组
      radio: "YES", //该片块图件是否为遗漏复垦点
      radio1: "YES", //审定规模与送审规模是否一致
      textarea: "",
      value: "",
      showChaKan: false, //显示隐藏查看框
      data: [
        {
          id: 1,
          label: "土地利用规划",
          children: [
            {
              id: 8,
              label: "总体规划"
            },
            {
              id: 9,
              label: "管理区规划"
            },
            {
              id: 10,
              label: "土地整治规划"
            }
          ]
        },
        {
          id: 2,
          label: "土地利用现状",
          children: [
            {
              id: 5,
              label: "2018年"
            },
            {
              id: 6,
              label: "2017年"
            }
          ]
        }
      ],
      activeName: "1",
      list: [],
      listLoading: true,
      listQuery: {
        page: 1,
        size: 10
      },
      total: 0, //总数
      defaultProps: {
        children: "children",
        label: "label"
      },
      shenchaFlag: false, //审查弹框控制
      showThreeFlag: false, //是否显示三个输入框
      fujianList: [], //附件数组
      itemData: "", //单个附件的数据
      yijianValue: "", //意见值
      yijianContent: "", //意见内容
      itemDataForTable: {
        landId: "", //片块ID
        isExistQuestions: "", //该片块图件是否存在问题
        isSetFukend: "", //是否设定为疑问复垦点
        problemReclaimProblemRecord: "", //意见内容
        problemReclaimPointOpinionType: "" //意见类型
      },
      dialogTitle: "", //弹框标题
      nowType: 1, //1为前期现状图 2为竣工现状图
      flag: 1,
      input: "",
      value1: "",
      queryCityCenterInfo: "", //基本信息
      opionionList: [], //意见类型
      opinionValue: "", //意见值
      attachmentInfo: "", //附件信息
      opinionContent: "", //意见内容
      attachment: "", //单个附件信息
      attachmentType: "", //附件类型
      mapConfig: {
        map: null,
        lng: 106.55,
        lat: 29.57,
        zoom: 10,
        lay: null
      },
      T: null,
      isText: true,
      loading: false,

      imgArr: [], //远近景照片
      seeImgDialog: false, //图片弹框
      seeImgTitle: "复垦远近景照片", //图片标题
      quanImg: {
        filePath: "",
        fileName: "全景照"
      },
      panoramaImg: require("@/assets/pure-house.jpg"),

      isLook: false, //判断当前流程（是否操作）

      isReadOnly: false,
      isShowCheck: true, //判断是否是查看附件

      curIndex: null,
      //意见
      yijianInfoData: {
        yijianValue: "",
        yijianContent: "",
        status: ""
      }
    };
  },
  created() {
    if (
      localStorage.getItem("router") ==
      "QUALIFIED_CERTIFICATE_APPLICATION_SECOND_AUDIT"
    ) {
      this.isReadOnly = false;
    } else {
      this.isReadOnly = true;
      this.isLook = true;
    }
    this.getData();
    this.getOpinionType();
    this.getAttachment();
  },
  methods: {
    //问题记录
    wentijilu(row) {
      var that = this;
      var data = {
        //projectId: localStorage.getItem("projectId"),
        landId: row.landId,
        statusMapOpinion: row.yijianContent,
        statusMapOpinionType: row.yijianValue
      };

      if (this.nowType == 1) {
        auditEarlyStatusMapInfo(data)
          .then(res => {
            this.$refs.tdMap.closeXianZhuang();
            console.log(res);
            if (res.code == 1000) {
              this.$message({
                message: "审查成功",
                type: "success"
              });
            }
          })
          .catch(error => {
            this.$refs.tdMap.closeXianZhuang();
          });
      } else if (this.nowType == 2) {
        auditLandStatusMapInfo(data)
          .then(res => {
            this.$refs.tdMap.closeXianZhuang();
            console.log(res);
            if (res.code == 1000) {
              this.$message({
                message: "审查成功",
                type: "success"
              });
            }
          })
          .catch(error => {
            this.$refs.tdMap.closeXianZhuang();
          });
      }
    },
    //获取现状图
    getXianZhangData(data) {
      var data = {
        landId: data.landId
      };
      if (this.nowType == 1) {
        queryEarlyXzt(data).then(res => {
          this.xianZhuangFliePath = res.data.statusMap.filePath;
          this.yijianInfoData.yijianValue =
            res.data.auditDto.earlyStatusMapOpinionType;
          this.yijianInfoData.yijianContent =
            res.data.auditDto.earlyStatusMapOpinion;
          this.yijianInfoData.status = res.data.auditDto.statusMapProblemStatus;
        });
      } else if (this.nowType == 2) {
        queryJungongXzt(data).then(res => {
          this.xianZhuangFliePath = res.data.statusMap.filePath;
          this.yijianInfoData.yijianValue =
            res.data.auditDto.laterStatusMapOpinionType;
          this.yijianInfoData.yijianContent =
            res.data.auditDto.laterStatusMapOpinion;
          this.yijianInfoData.status = res.data.auditDto.statusMapProblemStatus;
        });
      }
    },
    //前往查看现状图
    toSeeXianZhuang(row) {
      if (this.nowType == 66) {
        this.chakanImg(row, 1);
      } else if (this.nowType == 67) {
        this.chakanImg(row, 2);
      } else {
        this.getXianZhangData(row);
      }
    },
    //打开现状图
    handleXzViewInto(num) {
      this.nowType = Number(num);
      this.$refs.tdMap.handleXzView();
    },
    getCurListIndex(index) {
      //片块基本信息
      this.curIndex = index;
    },

    exportOpinion() {
      //导出意见
      var a = document.createElement("a");
      a.setAttribute(
        "href",
        this.$https +
          "/pc/land/certificate_application_first_audit/opinion_review?projectId=" +
          localStorage.getItem("projectId")
      );
      a.click();
    },
    //查看复垦前后的图片
    chakanImg(row, type) {
      console.log(row, "rowrowrow");
      this.seeImgDialog = true;
      this.imgArr = [];
      if (type == 1) {
        this.seeImgTitle = "复垦前远近景照片";
        if (
          row.earlyMappingActivityDto != null ||
          row.earlyMappingActivityDto != ""
        ) {
          if (
            row.earlyMappingActivityDto.landPositionOneFilePath != null &&
            row.earlyMappingActivityDto.landPositionOneFilePath != ""
          ) {
            this.imgArr.push({
              fileName: "方位照1",
              filePath: row.earlyMappingActivityDto.landPositionOneFilePath,
              id: 1
            });
          }
          if (
            row.earlyMappingActivityDto.landPositionTwoFilePath != null &&
            row.earlyMappingActivityDto.landPositionTwoFilePath != ""
          ) {
            this.imgArr.push({
              fileName: "方位照2",
              filePath: row.earlyMappingActivityDto.landPositionTwoFilePath,
              id: 2
            });
          }
          if (
            row.earlyMappingActivityDto.landPositionThreeFilePath != null &&
            row.earlyMappingActivityDto.landPositionThreeFilePath != ""
          ) {
            this.imgArr.push({
              fileName: "方位照3",
              filePath: row.earlyMappingActivityDto.landPositionThreeFilePath,
              id: 3
            });
          }
          if (
            row.earlyMappingActivityDto.landPositionFourFilePath != null &&
            row.earlyMappingActivityDto.landPositionFourFilePath != ""
          ) {
            this.imgArr.push({
              fileName: "方位照4",
              filePath: row.earlyMappingActivityDto.landPositionFourFilePath,
              id: 4
            });
          }
          if (
            row.earlyMappingActivityDto.panoramagramFilePath != null &&
            row.earlyMappingActivityDto.panoramagramFilePath != ""
          ) {
            this.quanImg.filePath =
              row.earlyMappingActivityDto.panoramagramFilePath;
            //this.panoramaImg=row.earlyMappingActivityDto.panoramagramFilePath
            if (!this.$refs.panorama) {
              this.$nextTick(() => {
                PhotoSphereViewer({
                  panorama: this.panoramaImg,
                  container: this.$refs.panorama,
                  time_anim: 3000,
                  navbar: true,
                  navbar_style: {
                    backgroundColor: "rgba(58, 67, 77, 0.7)"
                  }
                });
              });
            }
          }
          console.log(this.imgArr, "imgarr");
        }
      } else if (type == 2) {
        this.seeImgTitle = "复垦后远近景照片";
        if (
          row.laterMappingActivityDto != null ||
          row.laterMappingActivityDto != ""
        ) {
          if (
            row.laterMappingActivityDto.positionOneFilePath != null &&
            row.laterMappingActivityDto.positionOneFilePath != ""
          ) {
            this.imgArr.push({
              fileName: "方位照1",
              filePath: row.laterMappingActivityDto.positionOneFilePath,
              id: 1
            });
          }
          if (
            row.laterMappingActivityDto.positionTwoFilePath != null &&
            row.laterMappingActivityDto.positionTwoFilePath != ""
          ) {
            this.imgArr.push({
              fileName: "方位照2",
              filePath: row.laterMappingActivityDto.positionTwoFilePath,
              id: 2
            });
          }
          if (
            row.laterMappingActivityDto.positionThreeFilePath != null &&
            row.laterMappingActivityDto.positionThreeFilePath != ""
          ) {
            this.imgArr.push({
              fileName: "方位照3",
              filePath: row.laterMappingActivityDto.positionThreeFilePath,
              id: 3
            });
          }
          if (
            row.laterMappingActivityDto.positionFourFilePath != null &&
            row.laterMappingActivityDto.positionFourFilePath != ""
          ) {
            this.imgArr.push({
              fileName: "方位照4",
              filePath: row.laterMappingActivityDto.positionFourFilePath,
              id: 4
            });
          }
          if (
            row.laterMappingActivityDto.panoramagramFilePath != null &&
            row.laterMappingActivityDto.panoramagramFilePath != ""
          ) {
            this.quanImg.filePath =
              row.laterMappingActivityDto.panoramagramFilePath;
            //this.panoramaImg=row.laterMappingActivityDto.panoramagramFilePath
            if (!this.$refs.panorama) {
              this.$nextTick(() => {
                PhotoSphereViewer({
                  panorama: this.panoramaImg,
                  container: this.$refs.panorama,
                  time_anim: 3000,
                  navbar: true,
                  navbar_style: {
                    backgroundColor: "rgba(58, 67, 77, 0.7)"
                  }
                });
              });
            }
          }
        }
      }
    },
    isChangeSelect(val) {
      //是否显示选择错误类型
      if (val == "YES") {
        this.noWenti = true;
      } else if (val == "NO") {
        this.noWenti = false;
      }
    },
    //打开外业审查意见弹框
    shenchaWy(row) {
      console.log(row, "way");
      this.waiyeObj.landId = row.landId;
      if (row.auditDto.isStoringRecordInspectionStatus == "VIEW") {
        this.waiyeObj.waiyeRadio = row.auditDto.isStoringRecordInspection;
      } else if (row.auditDto.isStoringRecordInspectionStatus == "AUDIT") {
        this.waiyeObj.waiyeRadio = "";
      }
      this.shenchaFlag2 = true;
    },
    //提交外业意见
    submitWy() {
      console.log("审查");
      let obj = {
        landId: this.waiyeObj.landId,
        projectId: localStorage.getItem("projectId"),
        isStoringRecordInspection: this.waiyeObj.waiyeRadio
      };
      this.fullscreenLoading = true;
      hgzAuditLandOuterInfo(obj)
        .then(res => {
          this.fullscreenLoading = false;
          if (res.code == 1000) {
            this.$message({
              message: "审查成功",
              type: "success"
            });
            this.shenchaFlag2 = false;
            this.getData();
          }
        })
        .catch(error => {
          this.fullscreenLoading = false;
        });
    },
    //关闭外业意见
    handleClose2() {
      this.shenchaFlag2 = false;
    },
    //提交意见(列表)
    submitYj1() {
      this.fullscreenLoading = true;
      var that = this;

      var data = {
        landId: this.itemDataForTable.landId,
        isIdenticalScale: this.itemDataForTable.isExistQuestions,
        isMissingReclaimPoint: this.itemDataForTable.isSetFukend,
        auditScaleChangeReason: this.itemDataForTable
          .problemReclaimProblemRecord
      };
      if (this.itemDataForTable.isExistQuestions == "YES") {
        data[
          "auditScaleChangeReasonType"
        ] = this.itemDataForTable.problemReclaimPointOpinionType;
      }
      auditSecondAuditInfo(data).then(res => {
        this.fullscreenLoading = false;
        if (res.code == 1000) {
          this.isText = true;
          this.$message({
            message: "审查成功",
            type: "success"
          });
          that.getData();
          that.shenchaFlag = false;
          that.itemDataForTable = {
            landId: "", //片块ID
            problemReclaimProblemRecord: "",
            problemReclaimPointOpinionType: ""
          };
        }
      });
    },
    //审查意见
    shenchaYj(row) {
      console.log(row, "1345");
      this.itemDataForTable.landId = row.landId;
      if (row.auditDto.landStatus == "VIEW") {
        this.itemDataForTable.isExistQuestions = row.auditDto.isIdenticalScale;
        this.itemDataForTable.isSetFukend = row.auditDto.isMissingReclaimPoint;
        this.itemDataForTable.problemReclaimProblemRecord =
          row.auditDto.auditScaleChangeReason;
        this.itemDataForTable.problemReclaimPointOpinionType =
          row.auditDto.auditScaleChangeReasonType;

        if (this.itemDataForTable.isExistQuestions == "NO") {
          this.noWenti = false;
        } else {
          this.noWenti = true;
        }
      } else {
        this.itemDataForTable.isExistQuestions = "";
        this.itemDataForTable.isSetFukend = "";
        this.itemDataForTable.problemReclaimProblemRecord = "";
        this.itemDataForTable.problemReclaimPointOpinionType = "";
        this.noWenti = true;
      }
      this.shenchaFlag1 = true;
    },

    //校验审查
    checkTijiao() {
      let obj = {
        projectId: localStorage.getItem("projectId")
      };
      this.loading = true;
      verifyAttachmentOpinion(obj)
        .then(res => {
          this.loading = false;
          if (res.code == 1000) {
            this.$alert("全部审查成功,请前往意见中心进行审查", "提示", {
              confirmButtonText: "确定",
              callback: action => {}
            });
          }
        })
        .catch(error => {
          this.loading = false;
        });
    },
    changeText(v) {
      if (v == "NO_PROBLEM") {
        this.isText = false;
      } else {
        this.isText = true;
      }
    },
    chakanYj(row, type) {
      console.log(row, type);
      this.$router.push({
        path: "/hegezhengPeihao/qianqichjgcs/detail",
        query: {
          id: row.landId,
          type: type,
          isLook: this.isLook
        }
      });
    },
    handleClose1() {
      this.shenchaFlag1 = false;
    },
    btnOpinion() {
      //保存项目入库备案信息要件审查意见(附件意见)
      let obj = {
        projectId: localStorage.getItem("projectId"),
        accessoryId: this.attachment.id,
        opinion: this.opinionContent,
        opinionType: this.opinionValue,
        enclosureType: this.attachment.fileType
      };
      this.fullscreenLoading = true;
      saveCheckEnclosureOpinion(obj)
        .then(res => {
          this.fullscreenLoading = false;
          if (res.code == 1000) {
            this.$message({
              message: "提交成功",
              type: "success"
            });

            setTimeout(() => {
              this.getAttachment();
              this.showChaKan = false;
            }, 200);
          }
        })
        .catch(error => {
          this.fullscreenLoading = false;
        });
    },
    checkAttachment(item) {
      //查看附件信息
      this.attachment = item;

      if (item.opinionStatus == "VIEW") {
        this.opinionValue = item.opinionType;
        this.opinionContent = item.opinion;
        if (this.opinionValue == "NO_PROBLEM") {
          this.isText = false;
        } else {
          this.isText = true;
        }
      } else {
        this.yijianContent = "";
        this.yijianValue = "";
        this.isText = true;
      }
      if (
        (item.opinionStatus == "VIEW" && item.code == "view") ||
        (item.opinionStatus == "AUDIT" && item.code == "view")
      ) {
        this.isShowCheck = false;
      } else {
        this.isShowCheck = true;
      }
      this.showChaKan = true;
    },
    getAttachment() {
      //查询附件信息
      let obj = {
        projectId: localStorage.getItem("projectId")
      };
      queryCheckEnclosure(obj).then(res => {
        if (res.data != null) {
          if (res.data.attachmentList != null) {
            this.attachmentInfo = res.data.attachmentList;
          }
        }
      });
    },

    //获取意见类型
    getOpinionType() {
      queryOpinionType().then(res => {
        this.opionionList = res.data;
      });
      getQuestionsOpinionType().then(res => {
        this.qswuowuList = res.data;
      });
    },

    getData() {
      //获取列表数据
      this.listLoading = true;
      var data = {
        page: this.listQuery.page,
        size: this.listQuery.size,
        projectId: localStorage.getItem("projectId")
      };
      queryLandCertificateSectiondAuditInfo(data).then(res => {
        this.listLoading = false;
        this.list = res.data.rows;
        this.total = res.data.total;
      });
    },
    //改变每页显示条数
    handleSizeChange(val) {
      this.listQuery.size = val;
      this.getData();
    },
    //改变页码
    handleCurrentChange(num) {
      this.listQuery.page = num;
      this.getData();
    },
    handleClick(tab, event) {
      //tab切换
      console.log(this.activeName);
      this.showChaKan = false;
      this.textarea = "";
      this.value = "";
    },
    changeLnglat(scope) {
      //组件传值
      this.$refs.tdMap.changePkPosition(scope.$index);
    }
  }
};
</script>
<style>
#qianqichjgcs .el-tabs__nav-wrap::after {
  height: 1px;
}
#qianqichjgcs .mapBox {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  margin-bottom: 30px;
}
#qianqichjgcs .mapBox_left {
  width: 15%;
  border: 1px solid #e9e9e9;
  border-right: none;
}
#qianqichjgcs .mapBox_right {
  width: 85%;
  height: 600px;
}
#qianqichjgcs .ditudanghang {
  background: #f2f2f2;
  height: 40px;
  border-bottom: 1px solid #e9e9e9;
  overflow: hidden;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  color: #4d4d4d;
  line-height: 40px;
}
.fujianShenCha {
  overflow: auto;
}
#qianqichjgcs .fujianList {
  margin-top: 30px;
  float: left;
  width: 30%;
  box-sizing: border-box;
}
.chaKanBox {
  float: left;
  width: 68%;
  box-sizing: border-box;
}
#qianqichjgcs .fujianList_item {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  margin-left: 30px;
}
#qianqichjgcs .fujianList_item p {
  width: 300px;
  font-size: 14px;
  font-weight: bold;
  text-align: left;
  color: #444;
}
#qianqichjgcs .dachuShenChaBox {
  position: relative;
}
#qianqichjgcs .dachuShenCha {
  position: absolute;
  right: 0;
  top: 4px;
  display: flex;
}
#qianqichjgcs .dachuShenCha .dachuShenCha_item {
  font-size: 14px;
  color: #4d4d4d;
  cursor: pointer;
}
#qianqichjgcs .dachuShenCha .dachuShenCha_item:first-child {
  margin-right: 35px;
}

.showDetail {
  display: flex;
}
.chaKanBox_right_select {
  display: flex;
  align-items: center;
}
.chaKanBox_right_select p {
  font-size: 14px;
  color: #444;
  margin-right: 15px;
}
.chaKanBox_right {
  margin-left: 40px;
  width: calc(100% - 540px);
}
.chaKanBox_right_item {
  margin-bottom: 20px;
}
.chaKanBox_right_item_textarea {
  width: 100%;
}
.shenchaItem {
  display: flex;
  align-items: center;
}
.shenchaItem p {
  width: 230px;
  font-size: 14px;
  color: #444;
  font-weight: bold;
  text-align: left;
  white-space: nowrap;
}
.shenChaTanKuang .el-dialog {
  width: 500px;
}
.shenchaItem_item_textarea {
  width: 100%;
}
.shenchaItem_item_noFlex p {
  font-size: 14px;
  color: #444;
  font-weight: bold;
  text-align: left;
  white-space: nowrap;
}
.shenchaItem_small {
  margin-top: 20px;
}
.shenchaItem_small p {
  width: 100px;
}
.shenchaItem_item_input {
  width: 260px;
}

.el-tree-node__label {
  margin-left: 10px;
}
.seeImg {
  text-align: center;
  overflow: hidden;
}
.seeImg ul,
.seeImg li {
  list-style: none;
}
.seeImg li {
  float: left;
}
.seeImg li img {
  width: 400px;
  height: 400px;
  margin-right: 20px;
  margin-bottom: 20px;
}
#qianqichjgcs .CAD .el-button--medium {
  border-radius: 4px 0 0 4px;
}
.tableBasicInfo{
  margin: 20px auto;
  font-size: 14px;
  text-align: center;
  width: 90%;
  border: 1px solid #EBEEF5;
  box-sizing: border-box;
  border-bottom:0px; 
}

.tableBasicInfo tr th,.tableBasicInfo tr td{
  border-bottom: 1px solid #EBEEF5;
  padding: 5px 10px;
}
.tableBasicInfo tr th{
  border-right: 1px solid #EBEEF5;
  color: #b3b3b3;
}
.tableBasicInfo tr td{
  color: #666;
}
</style>
